package com.ysld.backend.util;

import com.alibaba.fastjson.JSONObject;


public class CommonUtil {

	/**
	 * 返回一个返回码为200的json
	 */
	public static JSONObject successJson(Object info) {
		JSONObject resultJson = new JSONObject();
		resultJson.put("code", 200);
		resultJson.put("info", info);
		return resultJson;
	}

	/**
	 * 返回一个返回码为404的json
	 */
	public static JSONObject notFoundJson(Object info) {
		JSONObject resultJson = new JSONObject();
		resultJson.put("code", 404);
		resultJson.put("info", info);
		return resultJson;
	}

	/**
	 * 返回一个返回码为403的json
	 */
	public static JSONObject validErrorJson(Object info) {
		JSONObject resultJson = new JSONObject();
		resultJson.put("code", 403);
		resultJson.put("info", info);
		return resultJson;
	}

}
